
<template>
    <rx-dialog @handOk="handleSubmit" @cancel="cancel">
        <rx-layout>
            <div slot="center">
                <a-form-model ref="form"  :model="mdl" :rules="rules" :label-col="labelCol" :wrapper-col="wrapperCol">
                                <a-form-model-item  :label="i18n('form.languageType','语言类型')" prop = "languageType">
                                        <a-input :placeholder="i18n('form.languageType','语言类型','input')" v-model="mdl.languageType"/>
                                </a-form-model-item>
                                <a-form-model-item  :label="i18n('form.timeZoneId','时区ID')" prop = "timeZoneId">
                                        <a-input :placeholder="i18n('form.timeZoneId','时区ID','input')" v-model="mdl.timeZoneId"/>
                                </a-form-model-item>
                                <a-form-model-item  :label="i18n('form.timeZoneName','时区名称')" prop = "timeZoneName">
                                        <a-input :placeholder="i18n('form.timeZoneName','时区名称','input')" v-model="mdl.timeZoneName"/>
                                </a-form-model-item>
                                <a-form-model-item :label="i18n('form.isDisable','是否可用')" prop="languageType">
                                    <a-switch v-model="isDisable"/>
                                </a-form-model-item>
                </a-form-model>

            </div>
        </rx-layout>
    </rx-dialog>
</template>
<script>
    import SysTimeZoneConfigApi from '@/api/system/core/sysTimeZoneConfig'
    import {RxDialog,BaseFormModel} from "@lowcode/jpaas-common-lib";


    export default {
        name: 'SysTimeZoneConfigEdit',
        mixins:[BaseFormModel],
        components: {
            RxDialog,
        },
        data(){
            return {
                /**
                 * 子表列表，以及表格属性
                 */
                subTable:{
        },
            rules: {
                languageType: [{ required:false,message:this.i18n('form.languageType','语言类型','input'), trigger: 'change' }],
                timeZoneId: [{ required:false,message:this.i18n('form.timeZoneId','时区ID','input'), trigger: 'change' }],
                timeZoneName: [{ required:false,message:this.i18n('form.timeZoneName','时区名称','input'), trigger: 'change' }],
                deleted: [{required: false, message: this.i18n('msa.delInfo','请输入逻辑删除'), trigger: 'change'}],
            },
            isDisable:true
        }

        },
        methods: {
            i18n(name,text,key){
                return this.$ti18(name,text,"SysTimeZoneConfig",key);
            },
            get(id){
                return SysTimeZoneConfigApi.get(id);
            },
            onload_(data){
                if("NO"==data.isDisable){
                    this.isDisable=false;
                }
            },
            save(){
                this.mdl.isDisable=this.isDisable?'YES':'NO';
                return SysTimeZoneConfigApi.save(this.mdl);
            },

        }
    }
</script>
<style>
    .relick a{
        margin-right: 10px;
    }

</style>
